﻿/*  
    Copyright (C) <2007-2013>  <Kay Diefenthal>

    ArgusTv.UI.MediaCenter is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ArgusTv.UI.MediaCenter is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ArgusTv.UI.MediaCenter.  If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Globalization;
using ArgusTV.DataContracts;
using Microsoft.MediaCenter.UI;

namespace ArgusTV.UI.MediaCenter.Models
{
    public class OnDemandOfferModel : ModelItem
    {
        private String _programTitle;
        private String _episodeTitle;
        private String _programDescription;
        private String _duration;

        public OnDemandOfferModel()
        {
            _programTitle = "";
            _episodeTitle = "";
            _programDescription = "";
            _duration = "";
        }

        public OnDemandOfferModel(GuideProgram program)
        {
            
            _programTitle = program.Title;
            _episodeTitle = program.SubTitle;
            _programDescription = program.Description;
            _duration = (program.StopTime-program.StartTime).TotalMinutes.ToString(CultureInfo.InvariantCulture);
        }

        public string ProgramTitle
        {
            get { return _programTitle; }
            set { _programTitle = value; FirePropertyChanged("ProgramTitle"); }
        }

        public string EpisodeTitle
        {
            get { return _episodeTitle; }
            set { _episodeTitle = value; FirePropertyChanged("EpisodeTitle"); }
        }

        public string ProgramDescription 
        {
            get { return _programDescription; }
            set { _programDescription = value; FirePropertyChanged("ProgramDescription"); }
        }

        public string Duration
        {
            get { return _duration; }
            set { _duration = value; FirePropertyChanged("Duration"); }
        }
    }
}
